const state = {
  last_page: [],
  now_page: ''
}

const mutations = {
  DECREMENT_MAIN_COUNTER (state) {
    state.main--
  },
  INCREMENT_MAIN_COUNTER (state) {
    state.main++
  },
  add(data) {
    state.last_page.push(data)
  },
  com(data) {
    state.now_page = data
  },
  clear() {
    state.last_page = []
  },
  delete() {
    state.last_page.pop()
  }
}

const actions = {
  someAsyncTask ({ commit }) {
    // do something async
    commit('INCREMENT_MAIN_COUNTER')
  }
}

export default {
  state,
  mutations,
  actions
}
